package com.zzxy.spring5.service.impl;


import com.zzxy.spring5.dao.IAccountDao;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Transactional(isolation = AccountServiceImpl.Isolation.DEFAULT,propagation = AccountServiceImpl.Propagation.REQUIRED)
public class AccountServiceImpl {
    private IAccountDao accountDao;

    public IAccountDao getAccountDao() {
        return accountDao;
    }

    public void setAccountDao(IAccountDao accountDao) {
        this.accountDao = accountDao;
    }

    @Override
    public void transer(String outer, String inner, int money) {
        accountDao.out(outer,money);
// int i=1/0;
        accountDao.in(inner,money);

    }

    private class Isolation {
    }

    private class Propagation {
    }
}
